<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../CSS/jutigequ.css">
    <script src="../Vuejs文件/vue.js"></script>
    <script src="../axios-master/dist/axios.min.js"></script>
</head>

<body>
    <div class="cover">
        <div class="imgAndSinger" id="imgAndSinger">
            <div style="width: 90%;text-align: right;font-size: 1.5em;font-weight: bolder;">
                <a href="#none" onclick="foldGeci()" class="foldBt" id="foldBt"> >> </a>
            </div>
            <div class="zjfm">
                <div class="imgCover2">
                    <div class="imgCover">
                        <img v-bind:src=picUrl+"?param=350y350" alt="" class="img" id="img">
                    </div>
                    <div class="circle" id="circle"></div>
                    <div class="top" id="top">
                        <div class="top1" id="top1"></div>
                    </div>
                    <div class="bottom" id="bottom">
                        <div class="bottom1" id="bottom1"></div>
                    </div>
                </div>
            </div>
            <div class="nameAndSinger">
                <p class="name">
                    {{songName}}
                </p>
                <p class="singer">
                    {{singer}}
                </p>
            </div>
        </div>
        <div class="geci" id="geci" @mousewheel="gunDon($event)">
            <ul id="lyricList">
                <li v-for="(item,index) in Lyric" v-bind:class="{songClass:item.isActive}">
                    <a href="##" @click="changePlayTime(item.time)">
                        <span v-bind:class="{songClass:item.isActive}">
                            {{item.lyric}}
                        </span>
                    </a>
                </li>
            </ul>
        </div>
        <div class="player">
            <video style="display: none;" v-bind:src=songUrl id="player" controls="controls" height="100px"
                width="300px"></video>
            <!--<button @click="preone">上一首</button>
            <input type="button" @click="changePlayMessage()" v-bind:value="isPlay.s[isPlay.index]">
            <button @click="nextone">下一首</button>
            <input type="button" value="列表" class="buttonList" @click="isShowSongList()">-->
            <a href="#" @click="preone" class="button button-3d button-action button-pill">上一首</a>
            <a href="#" @click="changePlayMessage()" class="button button-3d button-action button-pill">{{isPlay.s[isPlay.index]}}</a>
            <a href="#" @click="nextone" class="button button-3d button-action button-pill">下一首</a>
            <a href="#" @click="isShowSongList()" class="buttonList button button-3d button-action button-pill">列表</a>
        </div>
        <div class="songList" v-show="songListIsShow">
            <table style="width: 99%;">
                <tr v-for="(item,i) in songList" style="margin-top: 1%;" @click="changeSong(item.id)"
                    v-bind:class=item.id==songId?"choicedSong":"unChoicedSong" v-bind:id=i>
                    <td style="width: 60%;">
                        <div class="songListCantFlow">
                            {{item.name}}
                        </div>
                    </td>
                    <td style="width: 48%;">
                        <div class="songListCantFlow">
                            {{item.ar[0].name}}
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="progressBar">
            <div id="progress">
                <div id="bar">
                    <div id="thumb"></div>
                </div>
            </div>
            <div id="time">
                {{slider.slider.showNowTime}}/{{slider.slider.showTotalTime}}
            </div>
        </div>
    </div>
    <script>
        var gequIdList = JSON.parse(sessionStorage.getItem("gequIdList"));  //歌曲id列表-wch
        var timeNow;
        var fold = 0;   //用于记录歌词是否（0/1）展开
        var time = 0;   //用于专辑旋转
        var interval1;
        var state = 0;
        function $(id) { return document.getElementById(id) }

        //暂停
        function zt() {
            $("player").pause();
            clearInterval(interval1);
            xz(0);
            y.changeLyricClass(0, false);
            y.slider.resetTime(0, false);
        }
        //播放
        function bf() {

            if (y.slider.slider.nowTime >= y.slider.slider.totalTime - 1) {
                $("player").currentTime = 0;
            }
            $("player").play();
            y.slider.resetTime($("player").currentTime * 1000, true);
            y.changeLyricClass($("player").currentTime * 1000, true);
            console.log("启动");
            xz(1);
        }
        //专辑旋转,isStop-1--旋转，isStop-0--不旋转
        function xz(isStop) {
            if (isStop == 0) {
                clearInterval(interval1);
            } else {
                interval1 = setInterval(function () {
                    if ($("player").duration <= ($("player").currentTime)) {
                        clearInterval(interval1);
                        isStop = 0;
                        time = 0;
                    }
                    time = (time + 1) % 3600;
                    printCircle();
                    $("img").style.transform = "rotate(" + (time / 10 + 1) + "deg)";
                }, 5);
            }
        }
        //进度圆圈展开
        function printCircle() {
            var now = $("player").currentTime;
            var len = document.getElementById("player").duration;
            if (parseInt(len) / parseInt(now) >= 2) {
                document.getElementById("bottom1").style.opacity = 1;
                document.getElementById("top1").style.opacity = 1;
                document.getElementById("bottom1").style.transform =
                    "rotate(" + parseInt(parseInt(now) / parseInt(len) * 360) + "deg)";
                document.getElementById("top1").style.transform =
                    "rotate(0deg)";
            } else if (parseInt(len) / parseInt(now) > 1) {
                // console.log(1);
                document.getElementById("bottom1").style.opacity = 0;
                document.getElementById("top1").style.transform =
                    "rotate(" + parseInt(parseInt(now) / parseInt(len) * 360 - 180) + "deg)";
            } else {
                document.getElementById("bottom1").style.opacity = 0;
                document.getElementById("top1").style.opacity = 0;
            }
        }
        function foldGeci() {
            if (fold == 0) {
                $("imgAndSinger").style.width = "100%";
                $("geci").style.width = "0%";
                $("foldBt").innerText = "<<";
                // $("top").style.left = "38.5%";
                // $("bottom").style.left = "38.5%";
                // $("circle").style.left = "38.5%";
                fold = 1;
            } else {
                $("imgAndSinger").style.width = "50%";
                $("geci").style.width = "50%";
                $("foldBt").innerText = ">>";
                // $("top").style.left = "27.2%";
                // $("bottom").style.left = "27.2%";
                // $("circle").style.left = "27.2%";
                fold = 0;
            }
        }
        // console.log(ob2);
        var y = new Vue({
            el: ".cover",
            data: {
                setInterval1:null,  //进度条对象用的fun（）用的setinterval
                interval2:null, //y用的setinterval
                songId: sessionStorage.getItem("songId"),   //当前使用的歌曲id
                songIdList: gequIdList,  //歌曲id数组
                songList: [],  //歌曲列表
                position: -1,    //当前歌曲在歌列表里面的位置
                picUrl: null,   //当前用图url
                songName: null,  //歌名
                singer: null,    //歌手
                musicLyric: "",     /*歌词*/
                Lyric: [{
                    isActive: "",
                    lyric: "",
                    time: "",
                    isPureMusic: "",            //是否为纯音乐
                }],
                t: "",
                count: 0,
                Play: {
                    isPlay: false,
                    message: "播放",
                },
                songUrl: null,    //歌曲url
                freeTrialInfo: {        //收费歌曲的时间区域
                    end: 0,
                    start: 0,
                },
                songListIsShow: false,
                changeTop: 0,
                isPlay: {
                    s: ["播放", "暂停"],
                    index: 0,
                },
                slider: {
                    slider: {
                        begingX: "",
                        positionX: "",
                        sliderLength: "",
                        mouseDown: "",
                        mintues: "",
                        second: "",
                        nowTime: 0,
                        showNowTime: "",
                        totalTime: 0,
                        showTotalTime: "",
                        t: "",
                        t1: "",
                        isUse: true,
                    },
                    resetTime: function (time, flag) {
                        if (flag) {
                            y.isPlay.index = 1;
                            time = time / 1000;
                            var bar = document.getElementById("bar");
                            y.slider.slider.nowTime = time;
                            bar.style.width = y.slider.slider.nowTime / y.slider.slider.totalTime * 100 + "%";
                            y.slider.changeShowTime();
                            y.slider.slider.t = setTimeout(() => {
                                y.slider.slider.nowTime++;
                                y.slider.changeShowTime();
                                bar.style.width = y.slider.slider.nowTime / y.slider.slider.totalTime * 100 + "%";
                                y.slider.slider.t = setInterval(() => {
                                    y.slider.slider.nowTime++;
                                    y.slider.changeShowTime();
                                    bar.style.width = y.slider.slider.nowTime / y.slider.slider.totalTime * 100 + "%";
                                    if (y.slider.slider.nowTime >= y.slider.slider.totalTime) {
                                        y.slider.resetTime(0, false);
                                        y.changePlayMessage();
                                    }
                                }, 1000);
                            }, (1 - time % 1) * 1000);
                        } else {
                            y.isPlay.index = 0;
                            clearTimeout(y.slider.slider.t);
                            clearInterval(y.slider.slider.t);
                        }
                    },
                    changeShowTime: function () {
                        y.slider.slider.mintues = parseInt(y.slider.slider.totalTime / 60) < 10 ? "0" + parseInt(y.slider.slider.totalTime / 60) : parseInt(y.slider.slider.totalTime / 60);
                        y.slider.slider.second = parseInt(y.slider.slider.totalTime % 60) < 10 ? "0" + parseInt(y.slider.slider.totalTime % 60) : parseInt(y.slider.slider.totalTime % 60);
                        y.slider.slider.showTotalTime = y.slider.slider.mintues + ":" + y.slider.slider.second;
                        if (y.slider.slider.nowTime > y.slider.slider.totalTime) {
                            y.slider.slider.nowTime = y.slider.slider.totalTime;
                        }
                        y.slider.slider.mintues = parseInt(y.slider.slider.nowTime / 60) < 10 ? "0" + parseInt(y.slider.slider.nowTime / 60) : parseInt(y.slider.slider.nowTime / 60);
                        y.slider.slider.second = parseInt(y.slider.slider.nowTime % 60) < 10 ? "0" + parseInt(y.slider.slider.nowTime % 60) : parseInt(y.slider.slider.nowTime % 60);
                        y.slider.slider.showNowTime = y.slider.slider.mintues + ":" + y.slider.slider.second;
                    },
                    fun: function () {
                        var progressBar = document.getElementById("progressBar");
                        var progress = document.getElementById("progress");
                        var bar = document.getElementById("bar");
                        y.slider.resetTime(0, false);
                        if (y.slider.slider.isUse) {
                            t1 = setInterval(() => {
                                y.slider.slider.totalTime = $("player").duration;
                                y.slider.changeShowTime();
                                if (y.slider.slider.totalTime != NaN) {
                                    clearInterval(t1);
                                }
                            }, 500);
                        } else {
                            y.slider.slider.totalTime = 0;
                        }
                        y.slider.slider.nowTime = 0;
                        bar.style.width = "0%";
                        y.slider.changeShowTime();
                        progressBar.addEventListener("mousedown", function (e) {
                            if (e.button == 0) {
                                if (y.slider.slider.isUse) {
                                    y.slider.slider.begingX = progress.offsetLeft;
                                    y.slider.slider.sliderLength = progress.offsetWidth;
                                    y.slider.slider.mouseDown = true;
                                    y.slider.slider.positionX = e.clientX - y.slider.slider.begingX;
                                    if (y.slider.slider.positionX <= y.slider.slider.sliderLength && y.slider.slider.positionX >= 0) {
                                        y.slider.slider.nowTime = y.slider.slider.positionX / y.slider.slider.sliderLength * y.slider.slider.totalTime;
                                        $("player").currentTime = y.slider.slider.nowTime;
                                        y.slider.changeShowTime();
                                        bar.style.width = y.slider.slider.positionX / y.slider.slider.sliderLength * 100 + "%";
                                    }
                                }
                            }
                        });
                        progressBar.addEventListener("mousemove", function (e) {
                            if (y.slider.slider.isUse) {
                                if (y.slider.slider.mouseDown) {
                                    y.slider.resetTime(0, false);
                                    y.slider.slider.positionX = e.clientX - y.slider.slider.begingX;
                                    if (y.slider.slider.positionX <= y.slider.slider.sliderLength && y.slider.slider.positionX >= 0) {
                                        y.slider.slider.nowTime = y.slider.slider.positionX / y.slider.slider.sliderLength * y.slider.slider.totalTime;
                                        y.slider.changeShowTime();
                                        bar.style.width = y.slider.slider.positionX / y.slider.slider.sliderLength * 100 + "%";
                                    }
                                }
                            }
                        });
                        progressBar.addEventListener("mouseup", function () {
                            if (y.slider.slider.isUse) {
                                y.slider.slider.mouseDown = false;
                                $("player").currentTime = y.slider.slider.positionX / y.slider.slider.sliderLength * y.slider.slider.totalTime;
                                y.isPlay.index = 1;
                                zt();
                                bf();
                            }
                        });
                    },
                }
            },
            methods: {
                fun: function () {          //等待函数执行完毕播放
                    if(this.interval2!=null){
                        clearInterval(this.interval2);
                    }
                    this.interval2 = setInterval(() => {
                        if (parseInt($("player").currentTime) == 0) {
                            $("player").play();
                            // console.log("1111");
                        } else {
                            bf();
                            clearInterval(this.interval2);
                        }
                    }, 1);
                },
                changePlayMessage: function () {
                    if (this.slider.slider.isUse) {
                        if (this.isPlay.index == 0) {
                            bf();
                            this.isPlay.index = 1;
                        } else {
                            zt();
                            this.isPlay.index = 0;
                        }
                    }
                },
                gunDon: function (e) {       //鼠标滚轮滚动
                    var t = window.event.wheelDelta / 2;
                    e.preventDefault();      //阻值默认滚轮事件
                    if (t > 0 && this.changeTop >= 0) {

                    } else {
                        if (t < 0 && this.changeTop <= -this.Lyric.length * 20) {

                        } else {
                            this.changeTop += t;
                            $("lyricList").style.top = this.changeTop + "px";
                        }
                    }
                },
                changePlayTime: function (time) {       //点击歌词进行进度改动
                    if (this.slider.slider.isUse) {
                        if (!this.Lyric[0].isPureMusic) {
                            this.isPlay.index = 1;
                            $("player").currentTime = time / 1000;
                            this.slider.resetTime(0, false);
                            this.slider.resetTime(time, true);
                            zt();
                            bf();
                        }
                    }
                },
                getSongUrl: function () {
                    var t = this;
                    /*
                        接口地址：/song/url
                        例子：/song/url?id=33894312 /song/url?id=405998841,33894312
                        参数：
                            必选参数 : id : 音乐 id

                            可选参数 : br: 码率,默认设置了 999000 即最大码率,如果要 320k 则可设置为 320000,其他类推
                    */
                    axios.get(
                        "https://autumnfish.cn/song/url?id=" + t.songId
                    ).then(function (response) {
                        var r = response.data;
                        console.log(1);
                        console.log(r);
                        if (r.data[0].freeTrialInfo) {
                            t.freeTrialInfo = r.data[0].freeTrialInfo;
                        } else {
                            t.freeTrialInfo.start = 0;
                            t.freeTrialInfo.end = 0;
                        }
                        t.songUrl = r.data[0].url;
                        t.durationIsNaN();
                        t.getMusicIsUse();
                    }, function (err) {
                        console.log("歌曲url获取失败");
                    })
                },
                getSongList: function () {
                    var t = this;
                    var idl = "";
                    for (var i = 0; i < t.songIdList.length; i++) {
                        idl = this.songIdList[i];
                        axios.get(
                            "https://autumnfish.cn/song/detail?ids=" + idl
                        ).then(
                            function (response) {
                                var r = response.data;
                                // console.dir(r.songs);
                                t.songList.push(r.songs[0]);
                            },
                            function (err) {
                                console.log("获取2失败");
                                console.log(err);
                            }
                        )
                    }
                },
                getSong: function () {
                    var t = this;
                    var r;
                    axios.get(
                        "https://autumnfish.cn/song/detail?ids=" + t.songId
                    ).then(
                        function (response) {
                            r = response.data.songs[0];
                            console.log(r);
                            console.log("获取");
                            t.picUrl = r.al.picUrl;
                            t.songName = r.name;
                            t.singer = r.ar[0].name;
                        },
                        function (err) {
                            console.log("获取2失败");
                            console.log(err);
                        }
                    )
                }
                ,
                changeSong: function (id) {
                    var i;
                    for (i = 0; i < this.songList.length; i++) {
                        if (id == this.songList[i].id) {
                            break;
                        }
                    }
                    $("player").currentTime = 0;
                    printCircle();
                    $("img").style.transform = "rotate(0deg)";
                    time = 0;
                    this.position = i;
                    // console.log(this.position);
                    this.songId = this.songList[i].id;
                    this.picUrl = this.songList[i].al.picUrl;
                    this.songName = this.songList[i].name;
                    this.singer = this.songList[i].ar[0].name;
                    this.getSongUrl();
                    zt();
                    this.durationIsNaN();

                },
                getPosition: function () {
                    if (this.position == -1) {
                        for (var i = 0; i < this.songList.length; i++) {
                            if (this.songId == this.songList[i].id) {
                                this.position = i;
                                // console.log(i+"位置");
                                return i;
                            }
                        }
                    } else {
                        return this.position;
                    }
                }
                ,
                preone: function () {
                    if (this.getPosition() > 0) {
                        this.changeSong(this.songList[this.getPosition() - 1].id);
                    }
                },
                nextone: function () {
                    if (this.position < this.songList.length) {
                        this.changeSong(this.songList[this.getPosition() + 1].id);
                    }
                },
                changeLyricClass: function (time, flag) {
                    if (this.Lyric[0].isPureMusic) {
                        for (var i = 0; i < this.Lyric.length; i++) {
                            this.Lyric[i].isActive = true;
                        }
                    } else {
                        if (flag) {
                            for (var i = 0; i < this.Lyric.length; i++) {
                                this.Lyric[i].isActive = false;
                            }
                            for (var i = 0; i < this.Lyric.length; i++) {
                                if (i == this.Lyric.length - 1) {
                                    if (i > 10) {
                                        this.changeTop = -(i - 10) * 24;
                                    } else {
                                        this.changeTop = 0;
                                    }
                                    $("lyricList").style.top = this.changeTop + "px";
                                    this.Lyric[i].isActive = true;
                                    break;
                                } else {
                                    if (time < this.Lyric[0].time) {
                                        this.changeTop = 0;
                                        $("lyricList").style.top = this.changeTop + "px";
                                        this.Lyric[0].isActive = true;
                                        this.t = setTimeout(() => {
                                            this.changeLyricClass(this.Lyric[0].time, true);
                                        }, this.Lyric[0].time - time);
                                        break;
                                    } else {
                                        if (time >= this.Lyric[i].time && time < this.Lyric[i + 1].time) {
                                            if (i > 10) {
                                                this.changeTop = -(i - 10) * 24;
                                            } else {
                                                this.changeTop = 0;
                                            }
                                            $("lyricList").style.top = this.changeTop + "px";
                                            this.Lyric[i].isActive = true;
                                            this.t = setTimeout(() => {
                                                this.changeLyricClass(this.Lyric[i + 1].time, true);
                                            }, this.Lyric[i + 1].time - time);
                                            break;
                                        }
                                    }
                                }
                            }
                        } else {
                            clearTimeout(this.t);
                        }
                    }
                },
                getLyric: function () {
                    var that = this;
                    axios.get(
                        "https://autumnfish.cn/lyric?id=" + that.songId
                    ).then(function (response) {
                        console.log(response);
                        if (response.data.lrc) {
                            that.musicLyric = response.data.lrc.lyric;
                            // console.log(that.musicLyric);
                            that.splitLyric();
                        } else {
                            that.Lyric[0].lyric = "纯音乐，请欣赏";
                            that.Lyric[0].isPureMusic = true;
                        }
                    }, function (err) {

                    })
                },
                splitLyric: function () {
                    var s = this.musicLyric.split("\n");
                    var p;      //修正参数
                    var time = {
                        t1: new Array(),
                        t2: new Array(),
                        t3: new Array(),
                        t4: new Array(),
                        time: "",
                    };
                    var lyricList = [{
                        time: "",
                    }];
                    var temp = {
                        time: "",
                        lyric: "",
                    };
                    var string;
                    var index = 0;
                    var flag = true;
                    this.Lyric = [{
                        isActive: false,
                    }];
                    this.Lyric.shift();
                    lyricList.shift();
                    for (var i = 0; i < s.length; i++) {
                        index = 0;
                        while (s[i].indexOf("[", time.t1[index - 1] + 1) != -1) {
                            time.t1[index] = s[i].indexOf("[", time.t1[index - 1] + 1);
                            time.t2[index] = s[i].indexOf(":", time.t2[index - 1] + 1);
                            time.t3[index] = s[i].indexOf(".", time.t3[index - 1] + 1);
                            time.t4[index] = s[i].indexOf("]", time.t4[index - 1] + 1);
                            index++;
                        }
                        if (index == 0) {
                            if (!lyricList[0]) {
                                for (var i = 0; i < s.length; i++) {
                                    lyricList.push({
                                        time: 0,
                                        lyric: s[i],
                                        isPureMusic: true,
                                    });
                                }
                                break;
                            }
                        } else {
                            for (var j = index - 1; j >= 0; j--) {
                                if (time.t4[j] - time.t3[j] == 4) {
                                    p = 1;
                                } else {
                                    p = 10;
                                }
                                string = s[i].substring(time.t4[index - 1] + 1);
                                if (string != "") {
                                    time.time = parseInt(s[i].substring(time.t1[j] + 1, time.t2[j])) * 60000 + parseInt(s[i].substring(time.t2[j] + 1, time.t3[j])) * 1000 + parseInt(s[i].substring(time.t3[j] + 1, time.t4[j])) * p;
                                    if (this.freeTrialInfo.start == 0 && this.freeTrialInfo.end == 0) {

                                    } else {
                                        if (time.time < this.freeTrialInfo.start * 1000 || time.time > this.freeTrialInfo.end * 1000) {
                                            continue;
                                        }
                                    }
                                    lyricList.push({
                                        lyric: string,
                                        time: time.time - this.freeTrialInfo.start * 1000,
                                        isPureMusic: false,
                                    });
                                }
                            }
                        }
                    }
                    for (var i = 0; i < lyricList.length; i++) {
                        for (var j = 0; j < lyricList.length - 1; j++) {
                            if (lyricList[j].time > lyricList[j + 1].time) {
                                temp.time = lyricList[j].time;
                                temp.lyric = lyricList[j].lyric;
                                lyricList[j].time = lyricList[j + 1].time;
                                lyricList[j].lyric = lyricList[j + 1].lyric;
                                lyricList[j + 1].time = temp.time;
                                lyricList[j + 1].lyric = temp.lyric;
                            }
                        }
                    }
                    for (var i = 0; i < lyricList.length; i++) {
                        this.Lyric.push({
                            isActive: false,
                            lyric: lyricList[i].lyric,
                            time: lyricList[i].time,
                            isPureMusic: lyricList[i].isPureMusic,
                        });
                    }
                    // while (s[0].indexOf("[", time.t1[index - 1] + 1) != -1) {
                    //     time.t1[index] = s[0].indexOf("[", time.t1[index - 1] + 1);
                    //     time.t2[index] = s[0].indexOf(":", time.t2[index - 1] + 1);
                    //     time.t3[index] = s[0].indexOf(".", time.t3[index - 1] + 1);
                    //     time.t4[index] = s[0].indexOf("]", time.t4[index - 1] + 1);
                    //     index++;
                    // }
                    // for (var i = time.t1.length - 1; i >= 0; i--) {
                    //     for (var j = 0; j < s.length; j++) {
                    //         time.t1[i] = s[j].indexOf("[", time.t1[i - 1] + 1);
                    //         time.t2[i] = s[j].indexOf(":", time.t2[i - 1] + 1);
                    //         time.t3[i] = s[j].indexOf(".", time.t3[i - 1] + 1);
                    //         time.t4[i] = s[j].indexOf("]", time.t4[i - 1] + 1);
                    //         if (time.t4[i] - time.t3[i] == 4) {
                    //             p = 1;
                    //         } else {
                    //             p = 10;
                    //         }
                    //         string = s[j].substring(time.t4[i] + 1);
                    //         if (string != "") {
                    //             time.time = parseInt(s[j].substring(time.t1[i] + 1, time.t2[i])) * 60000 + parseInt(s[j].substring(time.t2[i] + 1, time.t3[i])) * 1000 + parseInt(s[j].substring(time.t3[i] + 1, time.t4[i])) * p;
                    //             if (this.freeTrialInfo.start == 0 && this.freeTrialInfo.end == 0) {

                    //             } else {
                    //                 if (time.time < this.freeTrialInfo.start * 1000 || time.time > this.freeTrialInfo.end * 1000) {
                    //                     continue;
                    //                 }
                    //             }
                    //             this.Lyric.push({
                    //                 isActive: false,
                    //                 lyric: string,
                    //                 time: time.time - this.freeTrialInfo.start * 1000,
                    //             });
                    //             if (this.Lyric.length > 1) {
                    //                 if (this.Lyric[this.Lyric.length - 1].time < this.Lyric[this.Lyric.length - 2].time) {
                    //                     flag = true;
                    //                     while (this.Lyric[j].time < this.Lyric[j - 1].time) {
                    //                         for (var k = 0; k < j; k++) {
                    //                             time.t1[i] = s[k].indexOf("[", time.t1[i - 1] + 1);
                    //                             time.t2[i] = s[k].indexOf(":", time.t2[i - 1] + 1);
                    //                             time.t3[i] = s[k].indexOf(".", time.t3[i - 1] + 1);
                    //                             time.t4[i] = s[k].indexOf("]", time.t4[i - 1] + 1);
                    //                             if (time.t4[i] - time.t3[i] == 4) {
                    //                                 p = 1;
                    //                             } else {
                    //                                 p = 10;
                    //                             }
                    //                             if (flag) {
                    //                                 this.Lyric[k].time = parseInt(s[k].substring(time.t2[i] + 1, time.t3[i])) * 1000 + parseInt(s[k].substring(time.t3[i] + 1, time.t4[i])) * p - this.freeTrialInfo.start * 1000;
                    //                             } else {
                    //                                 this.Lyric[k].time = parseInt(s[k].substring(time.t3[i] + 1, time.t4[i])) * p - this.freeTrialInfo.start * 1000;
                    //                             }
                    //                         }
                    //                         flag = false;
                    //                     }
                    //                 }
                    //             }
                    //         }
                    //     }
                    // }
                },
                isShowSongList: function () {
                    this.songListIsShow = !this.songListIsShow;
                },
                durationIsNaN: function () {      //查看是否已有歌曲总时长
                    if(this.setInterval1!=null){
                        clearInterval(this.setInterval1); 
                    }
                    this.setInterval1 = setInterval(() => {
                            if ($("player").duration != NaN) {
                                this.slider.resetTime(0, false);
                                clearInterval(this.setInterval1);
                                this.slider.fun();
                                this.getLyric();
                            }
                        }, 1000);
                },
                getMusicIsUse: function () {
                    var that = this;
                    axios.get(
                        "https://autumnfish.cn/check/music?id=" + that.songId
                    ).then(function (response) {
                        that.slider.slider.isUse = true;
                        that.fun();
                    }, function (err) {
                        if (that.freeTrialInfo.start == 0 && that.freeTrialInfo.end == 0) {
                            alert("该歌曲无版权");
                            that.slider.slider.isUse = false;
                        }
                    })
                }
            }
        });
        //初始化
        y.getSongUrl();
        y.getSongList();
        y.getSong();
    </script>
</body>

</html>